package com.xiamo.socket;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import javax.swing.JOptionPane;

/**
 * 
 *
 * @author Richard - rui.wu@bitmain.com
 * @since 2016年7月21日 
 *
 */
public class SocketDemo {
	public static void main(String[] args) {
		//1-65535
		try {
			ServerSocket serverSocket = new ServerSocket(12345);
			Socket socket = serverSocket.accept();
			JOptionPane.showConfirmDialog(null, "有客户端连接了12345端口");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
